Option Explicit Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Selection.Count = 1 Then If Not Intersect(Target, Range("D4")) Is Nothing Then call Area(Range("A1").Value, Range("A2").Value) End If End If End Sub Sub Area(x As Double, y As Double) MsgBox x * y End Sub #====================== Option Explicit Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Selection.Count = 1 Then If Not Intersect(Target, Range("D4")) Is Nothing Then call OpenPDFPage() End If End If End Sub #===== Option Explicit Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Selection.Count = 1 Then If Not Intersect(Target, Range("D4")) Is Nothing Then Dim PrgPath As String Dim PdfFile As String Dim PageCode As String Dim PageNo As Integer PrgPath = "C:\Program Files\Adobe\Reader 11.0\Reader\AcroRd32.exe" PdfFile = Range("A1").Value PageCode = "/A page=" PageNo = Range("A2").Value Shell PrgPath & " " & PageCode & PageNo & " " & PdfFile, 1 End If End If End Sub #====== Sub Replace() Dim rng As Range, cell As Range Set rng = Sheets("Sheet1").Range("A1:A629") For Each cell In rng cell = WorksheetFunction.Substitute(cell, ",", ";") Next End Sub #===== Sub ReplaceText() For Each c In Sheets("Sheet1").Range("A1:A629").Cells c = Replace(c.Value, ",", ";") Next c End Sub #===== http://stackoverflow.com/questions/32296386/how-to-pass-a-value-from-one-sub-to-another-in-excel-vba pass a value from one sub to another in Excel VBA #===== http://stackoverflow.com/questions/18968856/vba-paste-range paste range #===== Function Area(Length As Double, Width As Double) Area = Length * Width End Function #===== #=====